import request from '@/utils/request'
import { StatisticConfigSearch, TotalCensusTopData, StatisticList, StatisticBarConfig, StatisticConfigBar } from '@/model/business/questions/statistics/model'

// 问卷统计界面上层统计
export function getTotalCensusTopData (year:string) {
  return request<TotalCensusTopData>({
    url: `/census/totalTopData?year=${year}`,
    method: 'get'
  })
}

// 问卷统计界面列表数据
export function getTotalQuestionData (data: StatisticConfigSearch) {
  return request<StatisticList>({
    url: '/census/totalData',
    data: data,
    method: 'post'
  })
}

// 问卷统计界面柱状列表
export function getTotalBarData (data:StatisticConfigBar) {
  return request<StatisticBarConfig>({
    url: '/census/getTotalBarData',
    data: data,
    method: 'post'
  })
}
